// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_c;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.os.Environment;
import com.nnee.p_pr.p_a.cls_f;
import com.nnee.p_pr.p_atom.cls_u;
import com.nnee.p_pr.p_prov.i;
import java.io.File;
import java.util.LinkedList;
import java.util.List;

public class cls_a
{

    public cls_a()
    {
    }

    public static String a()
    {
        if(!(new File(l)).exists())
            (new File(l)).mkdirs();
        return l;
    }

    public static final List a(Context context)
    {
        String s = null;
        if(context != null) goto _L2; else goto _L1
_L1:
        return s;
_L2:
        Cursor cursor = context.getContentResolver().query(i.k, a, s, s, s);
        if(cursor == null) goto _L1; else goto _L3
_L3:
        LinkedList linkedlist;
        if(!cursor.moveToFirst())
            break MISSING_BLOCK_LABEL_178;
        linkedlist = new LinkedList();
        boolean flag;
        do
        {
            com.nnee.p_pr.p_atom.cls_b.aNormal a1 = new com.nnee.p_pr.p_atom.cls_b.aNormal();
            a1.a(cursor.getString(1));
            a1.d(cursor.getString(5));
            a1.e(cursor.getString(6));
            a1.f(cursor.getString(7));
            a1.a(cursor.getInt(8));
            a1.c(cursor.getString(4));
            a1.b(cursor.getString(3));
            linkedlist.add(a1);
            flag = cursor.moveToNext();
        } while(flag);
        cursor.close();
        s = linkedlist;
          goto _L1
        cursor.close();
          goto _L1
        Exception exception1;
        exception1;
        exception1.printStackTrace();
        cursor.close();
          goto _L1
        Exception exception;
        exception;
        cursor.close();
        throw exception;
    }

    public static final void a(Context context, String s, cls_u u1, com.nnee.p_pr.p_atom.cls_b.aNormal a1)
    {
        if(context != null && u1 != null && a1 != null && u1.V() != null && u1.V().length() != 0)
        {
            ContentValues contentvalues = new ContentValues();
            contentvalues.put("uid", u1.V());
            contentvalues.put("updated", s);
            contentvalues.put("image", a1.b());
            contentvalues.put("path", a1.c());
            contentvalues.put("flag", Integer.valueOf(a1.g()));
            contentvalues.put("type", a1.d());
            contentvalues.put("thumn_image", a1.e());
            contentvalues.put("thumb_path", a1.f());
            contentvalues.put("other", u1.toString());
            context.getContentResolver().insert(i.k, contentvalues);
        }
    }

    public static final void a(Context context, String s, LinkedList linkedlist, LinkedList linkedlist1)
    {
        if(context != null && linkedlist != null && linkedlist1 != null && linkedlist.size() == linkedlist1.size())
        {
            int i1 = 0;
            while(i1 < linkedlist.size()) 
            {
                cls_u u1 = (u)linkedlist.get(i1);
                com.nnee.p_pr.p_atom.cls_b.aNormal a1 = (com.nnee.p_pr.p_atom.cls_b.aNormal)linkedlist1.get(i1);
                if(u1 != null && a1 != null)
                    a(context, s, u1, a1);
                i1++;
            }
        }
    }

    public static final void a(List list)
    {
        com.nnee.p_pr.p_a.cls_f.a(new File(a()), list);
    }

    public static final void b(Context context)
    {
        if(context != null)
            context.getContentResolver().delete(i.k, null, null);
    }

    static String a[];
    static final int b = 0;
    static final int c = 1;
    static final int d = 2;
    static final int e = 3;
    static final int f = 4;
    static final int g = 5;
    static final int h = 6;
    static final int i = 7;
    static final int j = 8;
    static final int k = 9;
    static String l = (new StringBuilder()).append(Environment.getExternalStorageDirectory().toString()).append("/").append("p_pr").append("/convertimage/").toString();

    static 
    {
        String as[] = new String[10];
        as[0] = "_id";
        as[1] = "uid";
        as[2] = "updated";
        as[3] = "image";
        as[4] = "path";
        as[5] = "type";
        as[6] = "thumn_image";
        as[7] = "thumb_path";
        as[8] = "flag";
        as[9] = "other";
        a = as;
    }
}
